package com.adastros.buildingmanager.model;

import java.util.UUID;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.PrimaryKey;

@PersistenceCapable
public class Person {

  public enum Kind {
    BABY("Bebé"), CHILD("Niño"), ADULT("Adulto") ;
    
    private final String name ;
    
    private Kind(String name) {
      this.name = name ;
    }

    @Override
    public String toString() {
      return name ;
    }    
  }

  public enum Sex {
    MALE("Masculino"), FEMALE("Femenino") ;
    
    private final String name ;
    
    private Sex(String name) {
      this.name = name ;
    }

    @Override
    public String toString() {
      return name ;
    }
  }  
  
  @PrimaryKey
  private UUID id;  
  
  private String name;
  private String surName;
  
  private Sex sex ;
  private Kind kind ;
  
  private Contact contact;

  public Person() {
    id = UUID.randomUUID();
  }

  public UUID getId() {
    return id;
  }

  public void setId(UUID val) {
    this.id = val;
  }

  public String getName() {
    return name;
  }

  public void setName(String val) {
    this.name = val;
  }

  public String getSurName() {
    return surName;
  }

  public void setSurName(String val) {
    this.surName = val;
  }

  public Contact getContact() {
    return contact;
  }

  public void setContact(Contact contact) {
    this.contact = contact;
  }
  
  /**
   * @return the sex
   */
  public Sex getSex() {
    return sex;
  }

  /**
   * @param sex the sex to set
   */
  public void setSex(Sex sex) {
    this.sex = sex;
  }

  /**
   * @return the kind
   */
  public Kind getKind() {
    return kind;
  }

  /**
   * @param kind the kind to set
   */
  public void setKind(Kind kind) {
    this.kind = kind;
  }  
  
  @Override
  public String toString() {
    return "Person{\n" + " id=" + id + ",\n name=" + name + ",\n surName=" + surName + ",\n sex=" + sex + ",\n kind=" + kind + ",\n contact=" + contact + "\n}";
  }  
}
